﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;

namespace Q42.Wheels.Mvc.Paging.Example.Controllers
{
  [HandleError]
  public class SearchController : Controller
  {
    [Paging(DefaultSortColumn = "FullName", VaryByParams = new string[] { "query" })]
    public ActionResult Index(string query)
    {
      DirectoryInfo dir = new DirectoryInfo("C://Windows");
      
      return View(dir.EnumerateFiles(String.Format("*{0}*", query)));
    }
  }
}
